﻿using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using Sustainalytics.Entities;
using System;

namespace Sustainalytics.ClientDW.Entities
{
    [BsonIgnoreExtraElements]
    public class Incident : IEntity, IHasCompanyId
    {
        public Guid Id { get; set; }
        public Guid CompanyId { get; set; }
        public Guid EventIndicatorId { get; set; }
        public string EventIndicatorName { get; set; }
        public string IncidentId { get; set; }

        [BsonRepresentation(BsonType.String)]
        public IncidentType Type { get; set; }
        public string Name { get; set; }
        public string Summary { get; set; }
        public string Analysis { get; set; }
        public string MainTag { get; set; }
        public string Source { get; set; }
        public DateTime IncidentDate { get; set; }
        public Location Location { get; set; }
        public double ImpactScore { get; set; }
        public double RiskScore { get; set; }
        public DateTime LastUpdated { get; set; }
        public int ImpactTrend { get; set; }
        public int RiskTrend { get; set; }
        public bool IsMajorIncident { get; set; }
        public bool HasSupplyChainSpecialTag { get; set; }
        public string ExternalUrl { get; set; }
    }

    public enum IncidentType
    {
        InitialIncident = 0,
        IncidentUpdate,
        NewsUpdate
    }
}
